<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>


    // const selectParams = {
    //   more: '',
    //   rentType: undefined,
    //   price: undefined,
    //   undefined: undefined
    // }

    const selectParams = {
      more: '1',
      rentType: true,
      price: 1000,
      undefined: undefined
    }

    // 遍历对象
    Object.keys(selectParams).forEach(key => {
      // 删除无效的参数：
      //    1. key 是 'undefined'
      //    2. value 是 undefined, 'null', '' 之一的都属于无效值
      if ([undefined, 'null', ''].includes(selectParams[key])) {
        delete selectParams[key];
      }
    });

    console.log(selectParams);





  </script>
</body>

</html>